import React from 'react'

export default class Qq extends React.Component{
  constructor() {
    super()
    this.state = {
      message: '你真好'
    }
  }
  render() {
    return <div>
      <h2>  {this.state.message}</h2>
      {/* <input value={ this.state.message } readOnly/> */}
      <input ref="msg" value={ this.state.message } onChange={ (e)=> this.msgFn(e) }/>
    </div>
  }

  msgFn = (e) => {
    this.setState({
      message: this.refs.msg.value
    })

    // console.log(e.target.value)
    // this.setState({
    //   message: e.target.value
    // })
  }
}